package com.tz.actions;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;

/**
 * Created by Administrator on 16-9-28.
 */
@Namespace("/")
public class DemoAction extends ActionSupport {

    @Action(value = "demo1", results = {
            @Result(location = "demo2", type = "chain"),
    })
    public String demo1() {
        System.out.println("demo1() run...");
        return SUCCESS;
    }

    @Action(value = "demo2", results = {
            @Result(location = "demo3",type = "redirectAction"),
    })
    public String demo2() {
        System.out.println("demo2() run...");
        return SUCCESS;
    }

    @Action(value = "demo3", results = {
            @Result(location = "/demo3.jsp", type = "redirect"),
    })
    public String demo3() {
        System.out.println("demo3() run...");
        return SUCCESS;
    }

}
